﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision
{
	public class ListGenerator
	{
		public static IEnumerable<T> ConstantValueList<T>(T input, int Count = 1)
		{
			for (int i = 0; i < Count; i++)
			{
				yield return input;
			}
		}
		public static IEnumerable<int> IntegerList(int count, int start = 0, int step = 1)
		{
			for (int i = 0; i < count; i++)
			{
				yield return start + i * step;
			}
		}
		public static IEnumerable<TResult> ListFromFunction<TInput, TResult>(
			Func<TInput, TResult> functor, TInput start, TInput div, int Count)
		{
			for (int i = 0; i < Count; i++)
			{
				yield return functor(start + ((dynamic)div) * i);
			}
		}
	}
}
